# _*_ coding:utf-8 _*_
#xiaohei.python.seo.call.me:)
#win+python2.7.x
import urllib2
from bs4 import BeautifulSoup
def jd(url):
    page = urllib2.urlopen(url)
    html_doc = page.read()
    soup = BeautifulSoup(html_doc.decode('gb2312','ignore'))
    for i in soup.find_all('div', id="treemenu"):
        one = i.find_all('a')
        for a in one:
            b=a.string
            c=a.get('href')
            word=str(c)
            if '0_2' in word and 'BanKuai' not in word:
                print(word)
                print(b)
        #two = i.find_all('li')
        #print ("%s %s" % (one,two))
jd("http://quote.eastmoney.com/center/BKList.html")